import { ObjectSystemAttribute } from "../../../Decorator/Decorator";
import { NamedSystemObject } from "../../Object/NamedObject";
import { Entity } from "../Entity/Entity";
import { InstanceQueueIndex } from "./InstanceQueueIndex";
import { ISystemType } from "./ISystemType";

export interface ILoad {

}

export class ILoad {

}

export interface ILoadSystem extends ISystemType {

    Run(o: Object): void;

}

export class ILoadSystem {

    Run(o: Object): void {

    }

}

@ObjectSystemAttribute()
export abstract class LoadSystem<T extends Entity> extends NamedSystemObject implements ILoadSystem {

    constructor() {
        super();
    }

    Type() {
        return this.entityType;
    }

    SystemType() {
        return ILoadSystem.name;
    }

    GetInstanceQueueIndex(): InstanceQueueIndex {
        return InstanceQueueIndex.Load;
    }

    Run(o: Object): void {
        this.Load(<T>o);
    }

    abstract Load(self: T): void;

}